package com.demo.job.anno.config;

import com.demo.job.anno.utils.JobSpringExecutor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author peter
 * @date 2022/4/11 0:26
 */
@Configuration
public class JobConfig {

    @Value("${job.address}")
    private String address;

    @Bean
    public JobSpringExecutor jobSpringExecutor() {
        JobSpringExecutor jobSpringExecutor = new JobSpringExecutor();
        jobSpringExecutor.setAddress(address);
        return jobSpringExecutor;
    }
}
